package com.thinkingcoder.tcrpc.core.registry;

import java.util.List;

import com.thinkingcoder.tcrpc.core.meta.InstanceMeta;
import com.thinkingcoder.tcrpc.core.meta.ServiceMeta;

public interface RegistryCenter {

    void start(); // p/c

    void stop(); // p/c

    // Provider 侧
    void register(ServiceMeta service, InstanceMeta instance); // p

    void unRegister(ServiceMeta service, InstanceMeta instance); // p

    // Consumer 侧
    List<InstanceMeta> fetchAll(ServiceMeta service); // c

    void subscribe(ServiceMeta service, ChangedListener listener); // c

    // void heartbeat();

}
